var express = require('express');

//var Model = require('./Model');
//var Choice = require('./model/Choice');
//var Edge = require('./model/Edge');
//var Entity = require('./model/Entity');
//var Error = require('./model/Error');
//var Game = require('./model/Game');
//var Request = require('./model/Request');
////var Response = require('./model/Response');

var app = express.createServer();
var sessions = {}; // Hash Table of sessions by session ID

//var model = new Model(Entity);
//model.register('Choice', Choice);
//model.register('Edge', Edge);
//model.register('Error', Error);
//model.register('Game', Game);
//model.register('Request', Request);
////model.register('Response', Response);

app.configure(function() {
	app.use(express.methodOverride());
	app.use(express.bodyParser());
	app.use(app.router);
	app.use(express.static(__dirname + '/static'));
});

// Import Controls
var SignInControl = require('./control/SignIn');
var cSignIn = new SignInControl(app);

//var AddChoice = require('control/AddChoice');
//var cAddChoice = new AddChoice(app, session);



app.get('/', function(req, res) {
	res.redirect("/index.html");
});

var port = process.env.PORT || 3000;
app.listen(port, function() {
  console.log("Listening on " + port);
});